package com.sa.ibiz.demo.demo.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.cglib.beans.BeanGenerator;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import java.util.Map;
import java.util.HashMap;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import org.springframework.cglib.beans.BeanCopier;
import com.sa.ibiz.demo.ibizutil.annotation.Dict;
import com.sa.ibiz.demo.ibizutil.domain.EntityBase;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.math.BigInteger;
import com.sa.ibiz.demo.ibizutil.enums.FillMode;
import com.sa.ibiz.demo.ibizutil.enums.PredefinedType;
import com.sa.ibiz.demo.ibizutil.annotation.PreField;
import com.alibaba.fastjson.annotation.JSONField;


/**
 * 实体[DataSyncAgent] 数据对象
 */
@TableName(value = "T_SRFDATASYNCAGENT",resultMap = "DataSyncAgentResultMap")
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class DataSyncAgent extends EntityBase implements Serializable{

    private String agentparam;
    @Dict(dictName = "WorkflowMob_DataSyncAgentTypeCodeList")
    private String agenttype;
    private String clientid;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEDATE)
    private Timestamp createdate;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String createman;
    @TableId(value= "datasyncagentid",type=IdType.UUID)//指定主键生成策略
    private String datasyncagentid;
    private String datasyncagentname;
    @Dict(dictName = "WorkflowMob_YesNoCodeList")
    @TableLogic(value= "1",delval="0")//设定逻辑有效属性
    @TableField(fill = FieldFill.INSERT)
    private Integer enable;
    private String memo;
    private String pwd;
    private String serverpath;
    private String servicename;
    @Dict(dictName = "WorkflowMob_CodeList97CodeList")
    private String syncdir;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEDATE)
    private Timestamp updatedate;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String updateman;
    private String username;
    /**
     *  设置属性值[代理参数]
     *  @param agentparam
     */
    public void setAgentparam(String agentparam){
        if(StringUtils.isEmpty(agentparam))
            agentparam=null;
        this.agentparam = agentparam;
        this.set("agentparamdirtyflag",true);
    }
    /**
     *  获取属性值[代理参数]
     */
    public String getAgentparam(){
        return this.agentparam;
    }
    /**
     *  重置属性值[代理参数]
     */
    public void resetAgentparam(){
        this.set("agentparamdirtyflag",false);
        this.agentparam = null;
    }
    /**
     *  设置属性值[代理类型]
     *  @param agenttype
     */
    public void setAgenttype(String agenttype){
        if(StringUtils.isEmpty(agenttype))
            agenttype=null;
        this.agenttype = agenttype;
        this.set("agenttypedirtyflag",true);
    }
    /**
     *  获取属性值[代理类型]
     */
    public String getAgenttype(){
        return this.agenttype;
    }
    /**
     *  重置属性值[代理类型]
     */
    public void resetAgenttype(){
        this.set("agenttypedirtyflag",false);
        this.agenttype = null;
    }
    /**
     *  设置属性值[客户端标识]
     *  @param clientid
     */
    public void setClientid(String clientid){
        if(StringUtils.isEmpty(clientid))
            clientid=null;
        this.clientid = clientid;
        this.set("clientiddirtyflag",true);
    }
    /**
     *  获取属性值[客户端标识]
     */
    public String getClientid(){
        return this.clientid;
    }
    /**
     *  重置属性值[客户端标识]
     */
    public void resetClientid(){
        this.set("clientiddirtyflag",false);
        this.clientid = null;
    }
    /**
     *  设置属性值[建立时间]
     *  @param createdate
     */
    public void setCreatedate(Timestamp createdate){
        this.createdate = createdate;
        this.set("createdatedirtyflag",true);
    }
    /**
     *  获取属性值[建立时间]
     */
    public Timestamp getCreatedate(){
        return this.createdate;
    }
    /**
     *  重置属性值[建立时间]
     */
    public void resetCreatedate(){
        this.set("createdatedirtyflag",false);
        this.createdate = null;
    }
    /**
     *  设置属性值[建立人]
     *  @param createman
     */
    public void setCreateman(String createman){
        if(StringUtils.isEmpty(createman))
            createman=null;
        this.createman = createman;
        this.set("createmandirtyflag",true);
    }
    /**
     *  获取属性值[建立人]
     */
    public String getCreateman(){
        return this.createman;
    }
    /**
     *  重置属性值[建立人]
     */
    public void resetCreateman(){
        this.set("createmandirtyflag",false);
        this.createman = null;
    }
    /**
     *  设置属性值[数据同步代理标识]
     *  @param datasyncagentid
     */
    public void setDatasyncagentid(String datasyncagentid){
        if(StringUtils.isEmpty(datasyncagentid))
            datasyncagentid=null;
        this.datasyncagentid = datasyncagentid;
        this.set("datasyncagentiddirtyflag",true);
    }
    /**
     *  获取属性值[数据同步代理标识]
     */
    public String getDatasyncagentid(){
        return this.datasyncagentid;
    }
    /**
     *  重置属性值[数据同步代理标识]
     */
    public void resetDatasyncagentid(){
        this.set("datasyncagentiddirtyflag",false);
        this.datasyncagentid = null;
    }
    /**
     *  设置属性值[数据同步代理名称]
     *  @param datasyncagentname
     */
    public void setDatasyncagentname(String datasyncagentname){
        if(StringUtils.isEmpty(datasyncagentname))
            datasyncagentname=null;
        this.datasyncagentname = datasyncagentname;
        this.set("datasyncagentnamedirtyflag",true);
    }
    /**
     *  获取属性值[数据同步代理名称]
     */
    public String getDatasyncagentname(){
        return this.datasyncagentname;
    }
    /**
     *  重置属性值[数据同步代理名称]
     */
    public void resetDatasyncagentname(){
        this.set("datasyncagentnamedirtyflag",false);
        this.datasyncagentname = null;
    }
    /**
     *  设置属性值[逻辑有效标志]
     *  @param enable
     */
    public void setEnable(Integer enable){
        this.enable = enable;
        this.set("enabledirtyflag",true);
    }
    /**
     *  获取属性值[逻辑有效标志]
     */
    public Integer getEnable(){
        if(StringUtils.isEmpty(enable))
        {
            this.enable = 1;//设置逻辑有效值
            this.set("enabledirtyflag",true);
        }
        return this.enable;
    }
    /**
     *  重置属性值[逻辑有效标志]
     */
    public void resetEnable(){
        this.set("enabledirtyflag",false);
        this.enable = null;
    }
    /**
     *  设置属性值[备注]
     *  @param memo
     */
    public void setMemo(String memo){
        if(StringUtils.isEmpty(memo))
            memo=null;
        this.memo = memo;
        this.set("memodirtyflag",true);
    }
    /**
     *  获取属性值[备注]
     */
    public String getMemo(){
        return this.memo;
    }
    /**
     *  重置属性值[备注]
     */
    public void resetMemo(){
        this.set("memodirtyflag",false);
        this.memo = null;
    }
    /**
     *  设置属性值[访问密码]
     *  @param pwd
     */
    public void setPwd(String pwd){
        if(StringUtils.isEmpty(pwd))
            pwd=null;
        this.pwd = pwd;
        this.set("pwddirtyflag",true);
    }
    /**
     *  获取属性值[访问密码]
     */
    public String getPwd(){
        return this.pwd;
    }
    /**
     *  重置属性值[访问密码]
     */
    public void resetPwd(){
        this.set("pwddirtyflag",false);
        this.pwd = null;
    }
    /**
     *  设置属性值[远端地址]
     *  @param serverpath
     */
    public void setServerpath(String serverpath){
        if(StringUtils.isEmpty(serverpath))
            serverpath=null;
        this.serverpath = serverpath;
        this.set("serverpathdirtyflag",true);
    }
    /**
     *  获取属性值[远端地址]
     */
    public String getServerpath(){
        return this.serverpath;
    }
    /**
     *  重置属性值[远端地址]
     */
    public void resetServerpath(){
        this.set("serverpathdirtyflag",false);
        this.serverpath = null;
    }
    /**
     *  设置属性值[服务名称]
     *  @param servicename
     */
    public void setServicename(String servicename){
        if(StringUtils.isEmpty(servicename))
            servicename=null;
        this.servicename = servicename;
        this.set("servicenamedirtyflag",true);
    }
    /**
     *  获取属性值[服务名称]
     */
    public String getServicename(){
        return this.servicename;
    }
    /**
     *  重置属性值[服务名称]
     */
    public void resetServicename(){
        this.set("servicenamedirtyflag",false);
        this.servicename = null;
    }
    /**
     *  设置属性值[数据同步方向]
     *  @param syncdir
     */
    public void setSyncdir(String syncdir){
        if(StringUtils.isEmpty(syncdir))
            syncdir=null;
        this.syncdir = syncdir;
        this.set("syncdirdirtyflag",true);
    }
    /**
     *  获取属性值[数据同步方向]
     */
    public String getSyncdir(){
        return this.syncdir;
    }
    /**
     *  重置属性值[数据同步方向]
     */
    public void resetSyncdir(){
        this.set("syncdirdirtyflag",false);
        this.syncdir = null;
    }
    /**
     *  设置属性值[更新时间]
     *  @param updatedate
     */
    public void setUpdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
        this.set("updatedatedirtyflag",true);
    }
    /**
     *  获取属性值[更新时间]
     */
    public Timestamp getUpdatedate(){
        return this.updatedate;
    }
    /**
     *  重置属性值[更新时间]
     */
    public void resetUpdatedate(){
        this.set("updatedatedirtyflag",false);
        this.updatedate = null;
    }
    /**
     *  设置属性值[更新人]
     *  @param updateman
     */
    public void setUpdateman(String updateman){
        if(StringUtils.isEmpty(updateman))
            updateman=null;
        this.updateman = updateman;
        this.set("updatemandirtyflag",true);
    }
    /**
     *  获取属性值[更新人]
     */
    public String getUpdateman(){
        return this.updateman;
    }
    /**
     *  重置属性值[更新人]
     */
    public void resetUpdateman(){
        this.set("updatemandirtyflag",false);
        this.updateman = null;
    }
    /**
     *  设置属性值[访问用户]
     *  @param username
     */
    public void setUsername(String username){
        if(StringUtils.isEmpty(username))
            username=null;
        this.username = username;
        this.set("usernamedirtyflag",true);
    }
    /**
     *  获取属性值[访问用户]
     */
    public String getUsername(){
        return this.username;
    }
    /**
     *  重置属性值[访问用户]
     */
    public void resetUsername(){
        this.set("usernamedirtyflag",false);
        this.username = null;
    }
    /**
     * 重置当前数据对象属性值
     */
    public  void reset(){
        resetAgentparam();
        resetAgenttype();
        resetClientid();
        resetCreatedate();
        resetCreateman();
        resetDatasyncagentid();
        resetDatasyncagentname();
        resetEnable();
        resetMemo();
        resetPwd();
        resetServerpath();
        resetServicename();
        resetSyncdir();
        resetUpdatedate();
        resetUpdateman();
        resetUsername();
    }
     /**
     * 获取数据主键（普通主键与联合主键）
     * @return
     */
    @JsonIgnore
    public Serializable getDefaultPrimaryKey()
    {
	    //随机生成主键
         return  IdWorker.get32UUID();

    }
     /**
     * 复制当前对象数据到目标对象(粘贴重置)
     *
     * @throws Exception
     */
    public DataSyncAgent copyTo(DataSyncAgent targetEntity)
	{
		BeanCopier copier=BeanCopier.create(DataSyncAgent.class, DataSyncAgent.class, false);
		copier.copy(this, targetEntity, null);
        targetEntity.resetDatasyncagentid();
		return targetEntity;
	}
}